﻿Imports MySql.Data.MySqlClient
Public Class Welcome
    Private Sub myaccount_Click() Handles lblmyaccount.Click
        account.Show()
    End Sub
    Private Sub Welcome_Load() Handles Me.Load
        MsgBox("SFG Game Suite (Beta)", vbExclamation, "SFG")
        lblwelcome.Text = "Welcome, " & details.username
        panshout.Hide()
        lblgamemoney.Text = "Game Money: £ " & details.money
        btnshownews.Enabled = False
        txtreceive.Text = functions.getchatmessages()
        details.cheatmode = 0
    End Sub
    Private Sub Start_Slots() Handles picslots.Click
        pangames.Hide()
        panshout.Show()
        SlotsGame.Show()
        Me.Height = 248
        panshout.Left = 12 : panshout.Top = 50
        txtreceive.Width = 607
        txtsend.Width = 433
        btnsend.Width = 152
        btnsend.Left = 443 : btnsend.Top = 91
        panshout.Show()
        MsgBox("Pleae be aware that the game you are entering is still in beta testing")
        lblgamemoney.Text = "Game Money: In Game"
    End Sub
    Private Sub picgame2_Click() Handles picgame2.Click
        'pangames.Hide()
        'panshout.Show()
        'Me.Height = 248
        MsgBox("This Game is currently being coded")
    End Sub
    Private Sub picgame3_Click() Handles picgame3.Click
        'pangames.Hide()
        'panshout.Show()
        'Me.Height = 248
        MsgBox("This Game is currently being coded")
    End Sub
    Private Sub picgame4_Click() Handles picgame4.Click
        'pangames.Hide()
        'panshout.Show()
        'Me.Height = 248
        MsgBox("This Game is currently being coded")
    End Sub
    Private Sub Show_Chat() Handles btnshowchat.Click
        panshout.Left = 12 : panshout.Top = 215
        txtreceive.Width = 523
        txtsend.Width = 365
        btnsend.Width = 152
        btnsend.Left = 374 : btnsend.Top = 91
        panshout.Show()
        btnshowchat.Enabled = False
        btnshownews.Enabled = True
    End Sub
    Private Sub Show_News() Handles btnshownews.Click
        panshout.Hide()
        panshout.Left = 12 : panshout.Top = 50
        txtreceive.Width = 607
        txtsend.Width = 433
        btnsend.Width = 152
        btnsend.Left = 443 : btnsend.Top = 91
        btnshowchat.Enabled = False
        btnshownews.Enabled = True
        btnshownews.Enabled = False
        btnshowchat.Enabled = True
    End Sub
    Private Sub btnsend_Click() Handles btnsend.Click
        conn.connection.conn()
        Dim command = New MySqlCommand
        command.CommandText = "INSERT INTO `chat` (`from`, `timestamp`, `message`) VALUES ('" & details.username & "','" & functions.DateTimeToEpoch(Now) & "', '" & txtsend.Text & "')" 'Query to exectue.
        command.Connection = conn.connection.MyADOConnection
        Dim read = command.ExecuteReader
        conn.connection.MyADOConnection.Close()
        txtsend.Text = ""
        txtreceive.Text = functions.getchatmessages()
    End Sub
    Private Sub txtsend_TextChanged() Handles txtsend.TextChanged
        If txtsend.Text <> "" Then
            btnsend.Enabled = True
        Else
            btnsend.Enabled = False
        End If
    End Sub
    Private Sub Send_Feedback() Handles lblsf.LinkClicked
        sfb.Show()
    End Sub
    Private Sub closeing()
        functions.Update_Money()
    End Sub
End Class
